package com.cloudlead.customerAction.action;

import com.cloudlead.common.lang.annotation.Label;
import com.cloudlead.common.lang.persistence.Page;
import com.cloudlead.common.worker.action.impl.AbstractActionFactory;
import com.cloudlead.common.worker.annotation.Action;
import com.cloudlead.common.worker.annotation.Order;
import com.cloudlead.customerAction.BusinessModules;
import com.cloudlead.customerAction.service.TbFleetOrderFindSer;
import com.cloudlead.customerService.TbFleetOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.validation.constraints.NotNull;

/**
 * Created by 20150817 on 2015/8/31.
 */
@Controller
public class TbFleetOrderFindActionFactory extends AbstractActionFactory implements TbFleetOrderService{
    public TbFleetOrderFindActionFactory() {
        super(BusinessModules.OrderFind);
    }
    @Autowired
    TbFleetOrderFindSer tbFleetOrderFindSer;

    @Override
    @Action
    @Order(1)
    @Label("车队订单单值查询")
    public Object tbFleetOrderFind(@NotNull@Label("订单ID")String customerOrderId,@NotNull@Label("是否为起始港") String isStart) {
        return tbFleetOrderFindSer.tbFleetOrderFind(customerOrderId, isStart);
    }

    @Override
    @Action
    @Order(2)
    @Label("车队订单分页查询")
    public Page<Object> tbFleetOrderFindAll(@NotNull @Label("车队所属公司ID")String companyId,
            @Label("是否为起始港")String isStart,@Label("每页数量")int size,@Label("页码")int page) {
        return tbFleetOrderFindSer.tbFleetOrderFindAll(companyId,isStart,size,page);
    }

    @Override
    @Action
    @Order(3)
    @Label("车队订单")
    public String tbFleetOrderStatus(@NotNull @Label("车队订单ID")String id,@Label("订单状态【接受/不接受】") String orderStatus) {
        return tbFleetOrderFindSer.tbFleetOrderStatus(id, orderStatus);
    }
}
